/*******************************************************************\
| Plane.h
|
| CREATED:		26.5.2009
| DESCRIPTION:
| 
| 2D box/rectangle object
\********************************************************************/
#ifndef PLANE_H
#define PLANE_H

#include "Object.h"

namespace PhotonMapping
{


//*****************************************************************************
// class overview:
//  2D box/rectangle object implementation 
//-----------------------------------------------------------------------------
class Plane : public IObject
{
	public:
		// constructor
		Plane(const Math::Vector3& p_Normal, const float p_Dist, const intx p_Material);

		virtual intx TestIntersection(const Math::Ray& p_Ray, float &p_Distance);

		virtual const Math::Sphere& GetBoundingSphere() const;

		// return the surface normal for the given point
		virtual const Math::Vector3 GetNormalAt(const Math::Vector3& p_Pos);

	private:

		// plane normal
		Math::Vector3 m_Normal;

		// plane distance
		float m_Dist;

		// object bounding sphere
		Math::Sphere m_BoundingSphere;
};



} // PhotonMapping

#endif // PLANE_H
